package com.sc.VenusQueryBeta.adapter.account;

import com.chad.library.adapter.base.BaseViewHolder;
import com.hengjun.kingstar.sdk.utils.StringUtils;
import com.sc.VenusQueryBeta.R;
import com.sc.VenusQueryBeta.adapter.BaseCompatAdapter;
import com.sc.VenusQueryBeta.model.bean.account.CunDanBean;


/**
 * Created by Administrator on 2018/10/15.
 *
 */

public class CunDanAdapter extends BaseCompatAdapter<CunDanBean.DataBean, BaseViewHolder> {



    public CunDanAdapter(int layoutResId, CunDanBean cunDanBean) {
        super(layoutResId,cunDanBean.getData());
    }

    public CunDanAdapter(int item_cundan) {
        super(item_cundan);
    }

    @Override
    protected void convert(BaseViewHolder helper, CunDanBean.DataBean item) {
//        String s = String.valueOf(Math.round(Float.parseFloat(item.getDepostinum())));
        helper.setText(R.id.tv_account_name,item.getClientid());//户口
        helper.setText(R.id.tv_list_number,item.getFormid());//单号
        helper.setText(R.id.tv_money, StringUtils.FormatNumber(item.getDepostinum())+mContext.getString(R.string.wan));//钱
//        helper.setText(R.id.tv_time,item.getSettime());//存款时间

        //存款时间
        String year = item.getSettime().substring(0,4);
        String month = item.getSettime().substring(4,6);
        String day = item.getSettime().substring(6,8);
        String hour = item.getSettime().substring(8,10);
        String min = item.getSettime().substring(10);
//        String date = year+"/"+month+"/"+day+" "+hour+":"+min;
        String date = year+"/"+month+"/"+day;
        helper.setText(R.id.tv_time,date);

    }
}
